//
//  FoodOrdFormBottomV.swift
//  SlaughterClient
//
//  Created by 邱仙凯 on 2021/9/16.
//  Copyright © 2021 zwb. All rights reserved.
//

import UIKit

class ZyaFoodOrdFormBottomV: UIView {
    lazy var titleLab:UILabel = {
        let v = UILabel()
        v.text = "合计"
        return v
    }()
    lazy var subtitleLab:UILabel = {
        let v = UILabel()
        v.font = UIFont.systemFont(ofSize: 15)
        v.textColor = .lightGray
        v.text = "0.000kg"
        return v
    }()
    lazy var imgBtn:UIButton = {
        let v = UIButton()
        v.setImage(UIImage(named: "cart_circle"), for: .normal)
        return v
    }()
    
    lazy var badgeLabel:UILabel = {
        let auditNumLabel = UILabel()
        auditNumLabel.isHidden = true
        auditNumLabel.text = ""
        auditNumLabel.backgroundColor = UIColor.red
        auditNumLabel.textAlignment = .center
        auditNumLabel.textColor = UIColor.white
        auditNumLabel.font = UIFont.systemFont(ofSize: 11)
        auditNumLabel.layer.cornerRadius = 10
        auditNumLabel.layer.masksToBounds = true
        return auditNumLabel
        
    }()
    lazy var payBtn:UIButton = {
        let v = UIButton()
        v.setTitle("下单", for: .normal)
        v.setTitleColor(.white, for: .normal)
        v.backgroundColor = Theme.primaryColor()
        v.layer.cornerRadius = 17
        return v
    }()
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.backgroundColor = .white
        self.addSubview(imgBtn)
        imgBtn.snp.makeConstraints { make in
            make.centerY.equalTo(self)
            make.left.equalTo(self).offset(10)
            make.width.equalTo(40)
            make.height.equalTo(40)
        }
        self.addSubview(badgeLabel)
        badgeLabel.snp.makeConstraints { make in
            make.top.equalTo(imgBtn)
            make.right.equalTo(imgBtn)
            make.width.equalTo(20)
            make.height.equalTo(20)
        }
        self.addSubview(titleLab)
        titleLab.snp.makeConstraints { make in
            make.top.equalTo(self).offset(8)
            make.left.equalTo(imgBtn.snp.right).offset(10)
        }
        self.addSubview(subtitleLab)
        subtitleLab.snp.makeConstraints { make in
            make.bottom.equalTo(self).offset(-8)
            make.left.equalTo(titleLab)
        }
        self.addSubview(payBtn)
        payBtn.snp.makeConstraints { make in
            make.centerY.equalTo(self)
            make.right.equalTo(self).offset(-10)
            make.height.equalTo(35)
            make.width.equalTo(90)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
